import { getAll, dltStu, addStu, udtStu } from "@/api/goods.js"

export default {
    namespaced: true,
    state: {
        goodsStu: [],
        typeStu: ['苹果', '草莓', '梨', '西瓜', '葡萄', '香蕉'],
    },
    mutations: {
        udtStu(state, payload) {
            udtStu(payload._id, payload)
        },
        dltStu(state, payload) {
            dltStu(payload)
        },
        addStu(state, payload) {
            addStu(payload)
        }

    },
    actions: {
        get(state, payload) {
            getAll(payload).then((res) => {
                this.state.goods.goodsStu = res
            })
        },
    }
}